import { defineStore } from "pinia";
import * as memberBaseApi from "@/api/member-base";

export const useMemberBaseStore = defineStore("memberBase", () => {
  async function getMembers(param?: any) {
    const response = await memberBaseApi.getMembers(param);
    if (response.code === 20000) {
      return response.data.members;
    }
    return [];
  }

  async function getMember(param?: any) {
    const response = await memberBaseApi.getMember(param);
    if (response.code === 20000) {
      return response.data.member;
    }
    return {};
  }

  return { getMembers, getMember };
});
